package com.mac.mapper;

import com.mac.pojo.Collaborations;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
@SuppressWarnings({"all"})

public interface CollaborationsMapper {
    /**
     * 返回所有的合作成果
     * @return 返回合作成果集合
     */
    @Select("select * from collaborations")
    @ResultMap("collaborationsMap")
    ArrayList<Collaborations> selectAllCollaborations();

    /**
     * 根据研究成果id返回对应的合作成果
     * @param collaborationId 合作成果id
     * @return 返回 Collaborations 对象
     */
    @Select("select * from collaborations where collaboration_id = #{collaborationId}")
    @ResultMap("collaborationsMap")
    Collaborations selectOneBycollaborationId(@Param("collaborationId") int collaborationId);

}
